At present, the DHT has become the main organization form of the P2P overlay network, and its storage load balance is mainly realized by using virtual identifiers. In the distributed hash overlay network, there are two kinds of identifiers: the node ID and the virtual identifier. The node ID is used to differentiate different nodes so as to maintain the DHT overlay network, and the virtual identifier is used to divide the hash table space into several portions and allocate the same to each node. In a DHT overlay network, each node ID is different, and each virtual identifier is different as well. It is allowed that a node ID is the same as a virtual identifier. In the overlay network, the Hash Table space is divided into several portions according to all the virtual identifiers of all the nodes and certain dividing rules. The quantity of the portions is equal to that of the virtual identifiers, and each portion correlates with one virtual identifier. The Hash Table portion is under the charge of the node to which the virtual identifier correlating to the portion belongs. Each node is allocated with multiple virtual identifiers, so that it has to be in charge of multiple Hash Table portions. And, each data resource in the overlay network is allocated with a unique resource identifier. If the resource identifier of a data resource is in a Hash Table portion, the data resource is stored by the node in charge of the virtual identifier in the Hash Table portion. Thus, all the nodes ID and virtual identifiers in the overlay network form two different logic rings. The virtual identifiers make a detailed division to the Hash Table space. Each virtual identifier is in charge of the corresponding Hash block, and the data resource of the resource identifier falling in the Hash block is stored by the virtual identifier, thus achieving the effect of improving the network load balance.
As shown in FIG. 1, it is supposed that a Hash space is 0-63 and is equally divided into 12 portions by 12 virtual identifiers. In the network, there are four nodes, which are A, B, C and D respectively. The four nodes have their own node IDs: N1, N9, N28, N49, and the ability of each node is supposed to be the same. Then each node has three virtual identifiers. For example, node B has three virtual identifiers: P8, P28 and P43. The resource object is stored by the corresponding virtual identifier according to the relation between resource identifier and virtual identifier (if the resource identifier is K5, the virtual identifier P8 is in charge of it). In this case, as shown in Table 1, the Hash blocks under the charge of the three virtual identifiers of Node B are: (1, 8], (23, 28] and (38, 43]. The resources whose resource identifiers are in these space are under the charge of Node B. Thus the data resource space stored in each of the four nodes is 15 under this load balance method. See Table 1 for details. Since the resource identifiers are uniformly distributed in the whole Hash space, the data resource that each node is in charge of is in balance.
TABLE 1Node IDABCDDividingP3P18P38P8P28P43P23P48P58P13P33P53identifierData block(58, 3](13, 18](33, 38](3,8](23, 28](38, 43] (18, 23](43, 48] (53, 58](8,13](28, 33](48, 53]Data space555555555555in charge ofData space15151515under thecharge ofeach node
The inventors find that in the related art, to balance the load among nodes, the whole Hash space is equally divided into Q portions (that is, each is allocated with Q virtual identifiers), wherein Q is much greater than the quantity S of nodes. Then the virtual identifiers are allocated according to the ability of each node. For example, as shown in FIG. 2, the whole resource Hash space is equally divided into 10000 portions by 10000 virtual identifiers (circles on the outer ring). There are 10 nodes (circles on the inner ring) in the overlay network. Then, each node is in charge of 1000 virtual identifiers if the ability of each node is the same, which will increase workload for managing and transferring virtual identifiers. This is not convenient for managing and transferring virtual identifiers.